package com.orhon.smartcampus.modules.student.mm;



import java.util.List;

import org.mapstruct.InheritConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import com.orhon.smartcampus.modules.base.mm.GradeMapper;
import com.orhon.smartcampus.modules.base.mm.LangMapper;
import com.orhon.smartcampus.modules.base.mm.PeriodMapper;
import com.orhon.smartcampus.modules.student.entity.Arrives;
import com.orhon.smartcampus.modules.student.gqlModel.GQLArrives;

@Mapper(
        uses = {
                LangMapper.class,
                PeriodMapper.class,
                GradeMapper.class
        }
)
public interface ArrivesMapper {


    ArrivesMapper MAPPER = Mappers.getMapper(ArrivesMapper.class);


    @Mappings({
            @Mapping(source = "id" , target = "id"),
            @Mapping(source = "mark" , target = "mark"),
            @Mapping(source = "name" , target = "name"),
            @Mapping(source = "arrivesOrder" , target = "order"),
            @Mapping(source = "beginYear" , target = "begin_year"),
            @Mapping(source = "graduateYear" , target = "graduate_year"),
            @Mapping(source = "createdAt" , target = "created_at"),
            @Mapping(source = "updatedAt" , target = "updated_at"),
            @Mapping(source = "deletedAt" , target = "deleted_at"),
            @Mapping(source = "garduateStatus" , target = "garduate_status"),
            @Mapping(ignore = true, target = "grade" ),
            @Mapping(ignore = true, target = "period" ),
            @Mapping(ignore = true, target = "school" )
    })
    GQLArrives toArrives(Arrives entity);
    
    @InheritConfiguration(name = "toArrives")
    List<GQLArrives> toArrivesList(List<Arrives> entities);
}
